{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {},
   "outputs": [],
   "source": [
    "import numpy as np\n",
    "import pandas as pd\n",
    "\n",
    "df = pd.read_csv(\"NewcsvFile1.csv\")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 17,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "       feature1            feature2         feature3  feature4       feature5  \\\n",
      "0  1.331901e+09   CCHNFI4C6RAO93bP7   192.168.202.76      68.0  192.168.202.1   \n",
      "1  1.331901e+09  CouYOF1J4EnQkQNSl3   192.168.204.69      68.0  192.168.204.1   \n",
      "2  1.331901e+09  C9svD93TrEvPshF7Gf  192.168.202.102      68.0  192.168.202.1   \n",
      "3  1.331901e+09  C2nAD54rXz5nILppHh   192.168.202.76      68.0  192.168.202.1   \n",
      "4  1.331901e+09  CVRJN6491gIrhKWzHk   192.168.204.69      68.0  192.168.204.1   \n",
      "\n",
      "   feature6           feature7         feature8  feature9    feature10.  \n",
      "0      67.0  00:26:9e:83:a2:30   192.168.202.76       0.0  2.767872e+09  \n",
      "1      67.0  00:26:b9:da:95:2c   192.168.204.69       0.0  2.023310e+09  \n",
      "2      67.0  f0:de:f1:2e:6a:5a  192.168.202.102       0.0  7.111068e+06  \n",
      "3      67.0  00:26:9e:83:a2:30   192.168.202.76       0.0  4.022010e+09  \n",
      "4      67.0  00:26:b9:da:95:2c   192.168.204.69       0.0  3.428948e+09  \n"
     ]
    }
   ],
   "source": [
    "print(df.head())"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 11,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "['feature1',\n",
       " 'feature2',\n",
       " 'feature3',\n",
       " 'feature4',\n",
       " 'feature5',\n",
       " 'feature6',\n",
       " 'feature7',\n",
       " 'feature8',\n",
       " 'feature9',\n",
       " 'feature10.']"
      ]
     },
     "execution_count": 11,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "list(df.columns.values)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "metadata": {
    "collapsed": true
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "CimlH91iaxK3hlFON3    6\n",
      "Ctg2Tj2YjGaQCB22g3    4\n",
      "CQBlOy17xfrwwpO5D5    4\n",
      "Cul4Am1mNDZUjtYou1    4\n",
      "CXn1B81bbCFfuIqsI6    4\n",
      "CM2vsP1WUWtDN19W4     3\n",
      "CyN58N2grSHk3Y0iMb    3\n",
      "CPcbbN3JuM6ysmSJSi    3\n",
      "CVdRRb4t2Xl4QsuUBd    3\n",
      "CjlUSn3RaXRtl7N148    3\n",
      "CFvl7K1qTcivJun3w6    3\n",
      "CXR1N74pAbysD7Fg11    3\n",
      "ClGuzh3qdbQAMyurLk    3\n",
      "ClrvVg4O7AaeRAserc    3\n",
      "CPYcpj2M0iZkDiEu99    3\n",
      "C5zyl62tmqfwgnwojc    3\n",
      "CygqA24VI0joUnwYNd    3\n",
      "CoSefE4QAJCe2YZBie    3\n",
      "CwqPDd13H9Ku4ukcT4    2\n",
      "CD8TfR2UJf4gYe7S5i    2\n",
      "CSBJT94Xmr4I5oNDPf    2\n",
      "CblHKF44B485DmFVhc    2\n",
      "Ch3bRX1Xs7DBD3Kfth    2\n",
      "C53GrXQSd8yuQ2SYh     2\n",
      "C39G2x4glXUAB1lXE1    2\n",
      "CTWIHH2HFs3sPeYAp4    2\n",
      "CYr13pL4O1mh5lZi9     2\n",
      "CEhpRO3n83GxlWGmxc    2\n",
      "C6fiF91T1GFK0xYqVk    2\n",
      "C2dhxa4juR8fc03xsj    2\n",
      "                     ..\n",
      "CYmw1q6IX9p1k09Q8     1\n",
      "CeaOjh3Zkh8ba9x3Kg    1\n",
      "CaNfxj3wjc0zwwy5w6    1\n",
      "C7aVbS3H1kpZ8jFCtg    1\n",
      "CXlL6f4ahBkqaMEvcl    1\n",
      "Ca8LJXd6xg6kww5dj     1\n",
      "CVRJN6491gIrhKWzHk    1\n",
      "CcLHIl1Q41NIYxr0tf    1\n",
      "CUnIYE3cqKWwlf6dEj    1\n",
      "CAsjPtErJaWmJ9uGk     1\n",
      "CfwgqN1vtPDJw9dSy1    1\n",
      "CyRJoh4APgglIMD7D7    1\n",
      "CzgpsBj2Fb35vpzg4     1\n",
      "CjdcqQ17EKe5TlSVM1    1\n",
      "Cld53x4DA5QxQZA7B5    1\n",
      "CJEIxC2wS0BidSCKC8    1\n",
      "CYFq7m1yIprG7NOnQ7    1\n",
      "C9KM0B2nUL4gxGrdgl    1\n",
      "CVLDg34hvdWz0Cw3sf    1\n",
      "CHL3GP3gLnvn51kqQd    1\n",
      "CWLJNWOrJ5INoLQAi     1\n",
      "CzFE6s4jLH4c2onmY5    1\n",
      "CKjtBU19IAv9w05iG3    1\n",
      "CNA9UyJlCh0UdgtQ8     1\n",
      "CF9sK4CXTxhskWq46     1\n",
      "CUgmG6vYwznL3Wel4     1\n",
      "C2oyIQprFcnMnoDU6     1\n",
      "CkMm3C1fGVLIwqVduk    1\n",
      "CParje3YlhIdYQNOuf    1\n",
      "CrLxNt3hNGwogJTZ46    1\n",
      "Name: feature2, Length: 1418, dtype: int64\n"
     ]
    }
   ],
   "source": [
    "print(df['feature2'].value_counts())"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 13,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "192.168.202.76     744\n",
      "192.168.202.97      87\n",
      "192.168.202.85      79\n",
      "192.168.202.102     42\n",
      "192.168.202.141     40\n",
      "192.168.202.75      36\n",
      "192.168.202.91      35\n",
      "255.255.255.255     30\n",
      "192.168.202.115     26\n",
      "192.168.202.113     25\n",
      "192.168.202.112     20\n",
      "192.168.202.101     19\n",
      "192.168.202.65      19\n",
      "192.168.202.121     17\n",
      "192.168.202.89      17\n",
      "192.168.202.157     11\n",
      "192.168.202.94      10\n",
      "192.168.202.138     10\n",
      "192.168.202.84      10\n",
      "192.168.202.135      9\n",
      "192.168.202.109      8\n",
      "192.168.202.93       7\n",
      "192.168.202.110      7\n",
      "192.168.204.59       7\n",
      "192.168.202.125      7\n",
      "192.168.203.64       6\n",
      "192.168.202.133      6\n",
      "192.168.202.95       5\n",
      "192.168.204.72       5\n",
      "192.168.202.63       5\n",
      "                  ... \n",
      "192.168.203.63       2\n",
      "192.168.202.69       2\n",
      "192.168.202.155      2\n",
      "192.168.202.119      2\n",
      "192.168.202.152      2\n",
      "192.168.202.74       2\n",
      "192.168.202.134      1\n",
      "192.168.202.105      1\n",
      "192.168.202.131      1\n",
      "192.168.202.126      1\n",
      "192.168.202.148      1\n",
      "192.168.202.60       1\n",
      "192.168.202.146      1\n",
      "192.168.202.132      1\n",
      "192.168.202.108      1\n",
      "192.168.203.66       1\n",
      "192.168.202.86       1\n",
      "192.168.202.130      1\n",
      "192.168.202.128      1\n",
      "192.168.202.118      1\n",
      "192.168.202.98       1\n",
      "192.168.202.67       1\n",
      "192.168.202.68       1\n",
      "192.168.202.127      1\n",
      "192.168.202.150      1\n",
      "192.168.202.111      1\n",
      "192.168.202.151      1\n",
      "192.168.202.90       1\n",
      "192.168.202.153      1\n",
      "192.168.202.144      1\n",
      "Name: feature3, Length: 100, dtype: int64\n"
     ]
    }
   ],
   "source": [
    "print(df['feature3'].value_counts())"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 8,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "67.0    1502\n",
      "Name: feature6, dtype: int64\n"
     ]
    }
   ],
   "source": [
    "print(df['feature6'].value_counts())"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 9,
   "metadata": {
    "collapsed": true
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "192.168.202.76     744\n",
      "192.168.202.97      94\n",
      "192.168.202.85      79\n",
      "192.168.202.141     51\n",
      "192.168.202.102     42\n",
      "192.168.202.75      39\n",
      "192.168.202.91      35\n",
      "192.168.202.115     26\n",
      "192.168.202.113     25\n",
      "192.168.202.112     20\n",
      "192.168.202.65      19\n",
      "192.168.202.101     19\n",
      "192.168.202.121     17\n",
      "192.168.202.89      17\n",
      "192.168.202.157     11\n",
      "192.168.202.88      10\n",
      "192.168.202.84      10\n",
      "192.168.202.138     10\n",
      "192.168.202.94      10\n",
      "192.168.202.135      9\n",
      "192.168.202.109      8\n",
      "192.168.202.93       7\n",
      "192.168.202.110      7\n",
      "192.168.204.59       7\n",
      "192.168.202.125      7\n",
      "192.168.203.64       6\n",
      "192.168.202.133      6\n",
      "192.168.204.72       5\n",
      "192.168.202.62       5\n",
      "192.168.202.120      5\n",
      "                  ... \n",
      "192.168.202.83       2\n",
      "192.168.202.129      2\n",
      "192.168.202.155      2\n",
      "192.168.202.152      2\n",
      "192.168.202.116      2\n",
      "192.168.202.156      2\n",
      "192.168.202.71       2\n",
      "192.168.202.90       1\n",
      "192.168.202.148      1\n",
      "192.168.202.126      1\n",
      "192.168.202.131      1\n",
      "192.168.203.66       1\n",
      "192.168.202.144      1\n",
      "192.168.202.108      1\n",
      "192.168.202.127      1\n",
      "192.168.202.105      1\n",
      "192.168.202.150      1\n",
      "192.168.202.130      1\n",
      "192.168.202.128      1\n",
      "192.168.202.118      1\n",
      "192.168.202.132      1\n",
      "192.168.202.153      1\n",
      "192.168.202.134      1\n",
      "192.168.202.146      1\n",
      "192.168.202.98       1\n",
      "192.168.202.67       1\n",
      "192.168.202.68       1\n",
      "192.168.202.151      1\n",
      "192.168.202.111      1\n",
      "192.168.202.86       1\n",
      "Name: feature8, Length: 99, dtype: int64\n"
     ]
    }
   ],
   "source": [
    "print(df['feature8'].value_counts())"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 12,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "00:26:9e:83:a2:30    744\n",
      "00:23:54:8a:21:78     94\n",
      "00:24:54:eb:dc:f2     79\n",
      "08:11:96:8d:be:84     51\n",
      "f0:de:f1:2e:6a:5a     42\n",
      "00:0c:29:25:61:e1     39\n",
      "00:0c:29:98:25:c1     35\n",
      "98:4b:e1:4e:a3:7b     26\n",
      "b4:99:ba:f4:6a:63     25\n",
      "00:26:9e:23:5e:e4     20\n",
      "00:0c:29:8e:38:5a     19\n",
      "00:90:96:b8:7f:3d     19\n",
      "f0:de:f1:19:a5:d2     17\n",
      "bc:ae:c5:9e:f3:b6     17\n",
      "b4:99:ba:f4:6a:af     17\n",
      "d0:67:e5:2f:cb:65     11\n",
      "00:0c:29:93:57:1e     10\n",
      "c4:2c:03:37:0e:fc     10\n",
      "00:c0:ca:39:09:1e     10\n",
      "d4:9a:20:f9:b4:9c     10\n",
      "00:0c:29:e4:46:df      9\n",
      "b8:ac:6f:63:0e:f0      8\n",
      "60:fb:42:ef:54:40      7\n",
      "00:0c:29:1e:2f:4b      7\n",
      "00:0f:1f:a7:8b:b6      7\n",
      "00:0c:29:4e:9e:86      7\n",
      "08:00:27:c4:d4:ca      6\n",
      "f0:de:f1:9b:ad:6a      5\n",
      "00:0c:29:6e:4b:67      5\n",
      "3c:07:54:1c:a6:65      5\n",
      "                    ... \n",
      "b8:8d:12:12:3f:90      2\n",
      "00:0c:29:18:b6:67      2\n",
      "3c:07:54:41:3e:d3      2\n",
      "00:90:96:b8:8e:91      2\n",
      "00:0c:29:4d:eb:9e      2\n",
      "00:0c:29:e0:b4:72      2\n",
      "c8:60:00:1a:9f:29      2\n",
      "08:00:27:10:b3:46      2\n",
      "00:50:43:01:95:e1      2\n",
      "00:26:18:f9:be:98      2\n",
      "00:0c:29:d9:9f:09      2\n",
      "40:3c:fc:06:98:a4      2\n",
      "00:16:cb:ab:6f:f8      2\n",
      "00:0c:29:5b:22:06      1\n",
      "00:1f:16:e5:71:da      1\n",
      "9a:4b:e1:4e:a3:7b      1\n",
      "00:0c:29:e4:75:97      1\n",
      "00:0c:29:29:66:1f      1\n",
      "5c:26:0a:11:4a:0d      1\n",
      "de:ad:be:ef:be:ef      1\n",
      "60:c5:47:93:38:1e      1\n",
      "00:0c:29:f5:b2:55      1\n",
      "00:0c:29:89:d0:73      1\n",
      "00:0c:29:6c:bf:67      1\n",
      "00:0c:29:d9:46:21      1\n",
      "3c:d0:f8:34:47:65      1\n",
      "00:0c:29:93:20:9e      1\n",
      "00:0c:29:ad:12:94      1\n",
      "5c:26:0a:54:e9:7c      1\n",
      "00:0c:29:4d:6b:94      1\n",
      "Name: feature7, Length: 87, dtype: int64\n"
     ]
    }
   ],
   "source": [
    "print(df['feature7'].value_counts())"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# Handling missing data"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 15,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "feature10.    1\n",
       "feature9      1\n",
       "feature8      1\n",
       "feature7      1\n",
       "feature6      1\n",
       "feature5      1\n",
       "feature4      1\n",
       "feature3      1\n",
       "feature2      1\n",
       "feature1      1\n",
       "dtype: int64"
      ]
     },
     "execution_count": 15,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df.isnull().sum().sort_values(ascending=False)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "The dataset may be the missing last row"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 18,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "          feature1            feature2         feature3  feature4  \\\n",
      "1498  1.332016e+09  CiXghT1o04iEMCRt95  192.168.202.152      68.0   \n",
      "1499  1.332016e+09  ClmudR1pTjxo5ujzq3   192.168.202.97      68.0   \n",
      "1500  1.332016e+09   C1Gt9C1V7VZMujMwi   192.168.202.64      68.0   \n",
      "1501  1.332017e+09   CLPHStU4Iw1izzEA5   192.168.202.82      68.0   \n",
      "1502           NaN                 NaN              NaN       NaN   \n",
      "\n",
      "           feature5  feature6           feature7         feature8  feature9  \\\n",
      "1498  192.168.202.1      67.0  c8:60:00:1a:9f:29  192.168.202.152   86400.0   \n",
      "1499  192.168.202.1      67.0  00:23:54:8a:21:78   192.168.202.97       0.0   \n",
      "1500  192.168.202.1      67.0  c8:60:00:1a:aa:77   192.168.202.64   86400.0   \n",
      "1501  192.168.202.1      67.0  00:0c:29:78:10:23   192.168.202.82   86400.0   \n",
      "1502            NaN       NaN                NaN              NaN       NaN   \n",
      "\n",
      "        feature10.  \n",
      "1498  3.965556e+09  \n",
      "1499  1.007805e+09  \n",
      "1500  2.952970e+09  \n",
      "1501  3.170925e+09  \n",
      "1502           NaN  \n"
     ]
    }
   ],
   "source": [
    "print(df.tail())"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.6.6"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
